{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/employee-importance/\n",
    "\n",
    "\n",
    "Runtime: 12 ms, faster than 78.72% of Go online submissions for Employee Importance.\n",
    "Memory Usage: 6.2 MB, less than 35.11% of Go online submissions for Employee Importance.\n",
    "\n",
    "\n",
    "```go\n",
    "func getImportance(employees []*Employee, id int) int {\n",
    "\t//5:28\n",
    "\tm := make(map[int]*Employee)\n",
    "\tfor i := 0; i < len(employees); i++ {\n",
    "\t\tm[employees[i].Id] = employees[i]\n",
    "\t}\n",
    "\timportance := 0\n",
    "\tq := make([]int, 0)\n",
    "\tq = append(q, id)\n",
    "\tfor len(q) != 0 {\n",
    "\t\tid = q[0]\n",
    "\t\tq = q[1:]\n",
    "\t\timportance += m[id].Importance\n",
    "\t\tq = append(q, m[id].Subordinates...)\n",
    "\t}\n",
    "\treturn importance\n",
    "\t//5:46\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Go",
   "language": "go",
   "name": "gophernotes"
  },
  "language_info": {
   "codemirror_mode": "",
   "file_extension": ".go",
   "mimetype": "",
   "name": "go",
   "nbconvert_exporter": "",
   "pygments_lexer": "",
   "version": "go1.15.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
